home *** CD-ROM | disk | FTP | other *** search
/ Champak 125 / Vol 125 (Damaged).iso / games / spiderma.swf / scripts / DefineSprite_14_jul_bat / frame_1 / DoAction.as
Encoding:
Text File  |  2008-11-13  |  1.8 KB  |  60 lines

  1. batNum = _root.julNum;
  2. julagain = 0;
  3. julspeed = 55;
  4. do
  5. {
  6.    jul_speed = random(7) + 5;
  7.    if(jul_speed != _root.julpoz["jul" + (_root.julNum - 1)].jul_speed)
  8.    {
  9.       break;
  10.    }
  11. }
  12. while(jul_speed == _root.julpoz["jul" + (_root.julNum - 1)].jul_speed);
  13.  
  14. bat_julNum = 0;
  15. batmove = 0;
  16. randpoz1 = random(60) + 150;
  17. randpoz2 = random(60) + 450;
  18. this.onEnterFrame = function()
  19. {
  20.    bat_julNum += jul_speed;
  21.    this._rotation = julspeed * Math.cos(bat_julNum * 0.017453292519943295) + 90;
  22.    if(bat_julNum > 360)
  23.    {
  24.       bat_julNum -= 360;
  25.    }
  26.    if(_root.spidermove == 2 & batNum == _root.julNum - 1)
  27.    {
  28.       _root.spiderman.gotoAndStop("ready");
  29.       spiderbatpoz = new Object();
  30.       spiderbatpoz.x = _root.julpoz["jul" + (_root.julNum - 1)].batman.point._x;
  31.       spiderbatpoz.y = _root.julpoz["jul" + (_root.julNum - 1)].batman.point._y;
  32.       _root.julpoz["jul" + (_root.julNum - 1)].batman.localToGlobal(spiderbatpoz);
  33.       _root.spacepress = 0;
  34.       _root.spiderman._rotation = _root.julpoz["jul" + (_root.julNum - 1)]._rotation;
  35.       _root.spidermanangle = _root.spiderman._rotation;
  36.       _root.jumpangle = 360 - _root.spidermanangle - 90;
  37.       _root.spiderman._x = spiderbatpoz.x;
  38.       _root.spiderman._y = spiderbatpoz.y;
  39.       if(_root.hitNum == 1)
  40.       {
  41.          _root.julpoz.attachMovie("jul_bat","jul" + _root.julNum,_root.julNum);
  42.          _root.julpoz["jul" + _root.julNum]._x = -150;
  43.          _root.hitNum = 0;
  44.       }
  45.    }
  46.    this._x += 5;
  47.    if(_root.julpoz["jul" + _root.julNum]._x >= randpoz1)
  48.    {
  49.       _root.julpoz["jul" + _root.julNum]._x = randpoz1;
  50.    }
  51.    if(_root.julpoz["jul" + (_root.julNum - 1)]._x >= randpoz2)
  52.    {
  53.       _root.julpoz["jul" + (_root.julNum - 1)]._x = randpoz2;
  54.    }
  55.    if(this._x > 750)
  56.    {
  57.       this.removeMovieClip();
  58.    }
  59. };
  60.